<template>
  <div>
    <h4>Child</h4>
    <div>我是Child</div>
    <button @click="getParent($parent)">点击获取父组件的count</button>
  </div>
</template>

<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  name: "Child",
});
</script>

<script setup lang="ts">
const getParent = (parent:any) => {
  console.log(parent.count);
}
</script>
